﻿<navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    x:Class="QDP.Platform.Admin.Views.Option" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:local="clr-namespace:QDP.Platform.Admin.ViewModels"
    Title="专题展示系统-后台管理" mc:Ignorable="d"
    Style="{StaticResource PageStyle}">
    <Grid x:Name="LayoutRoot" DataContext="{StaticResource ViewModel}">
        <ListBox ItemsSource="{Binding Path=Sets}">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Grid Margin="2,1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="150" />
                                        <ColumnDefinition Width="5" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="30" />
                                    </Grid.ColumnDefinitions>
                                    <TextBox Text="{Binding Key,Mode=TwoWay}"/>
                                    <TextBox Text="{Binding Value,Mode=TwoWay}" Grid.Column="2"/>
                                    <Button x:Name="delete" Content="Delete" Margin="4,0" Grid.Column="3"
                                            HorizontalAlignment="Center" VerticalAlignment="Center"
                                            Command="{Binding DeleteCommand, Mode=OneWay, Source={StaticResource ViewModel}}"
                                            CommandParameter="{Binding Mode=OneWay}"
                                            Style="{StaticResource Delete-Button}" Width="15"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
        </ListBox>
        <toolkit:BusyIndicator IsBusy="{Binding IsBusy}"/>
    </Grid>
</navigation:Page>
